#ifndef PUSH_BUTTON_H
#define PUSH_BUTTON_H
#include <QPushButton>
#include <QPainter>
#include <QMouseEvent>

class PushButton : public QPushButton
{
	Q_OBJECT
public:
	explicit PushButton(QWidget* parent = nullptr);
	~PushButton();
public:
	void loadPixmap(const QString& bitmap);
protected:
	void enterEvent(QEvent* ee);
	void leaveEvent(QEvent* le);
	void mousePressEvent(QMouseEvent* qme);
	void mouseReleaseEvent(QMouseEvent* qme);
	void paintEvent(QPaintEvent* qpe);
private:
	enum ButtonStatus
	{
		NORMAL,
		ENTER, 
		PRESS, 
		NOSTATUS
	};
	
	ButtonStatus status;
	QPixmap mPixmap; 

	int  mWidth;
	int  mHeight; 
	bool mMousePress; 
};

#endif